﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Home_Active : System.Web.UI.Page
{
    public LanguageManage Language;
    UserEntity currentUser;
    protected void Page_Load(object sender, EventArgs e)
    {
        //Check login
        currentUser = UserManager.Instance.Getuser();
        if (!currentUser.isLogin)
            Response.Redirect("~/Login.aspx");
        Language = new LanguageManage();
        long BookID = 0;              

        try
        {
            BookID = long.Parse(Request.QueryString["bookid"]);
            bool active=bool.Parse(Request.QueryString["active"]);
            if (BookID > 0)
            {
                BookAdapter adp = new BookAdapter();
                bool result = adp.ActiveBook(BookID, active);
                if (!result)
                {
                    
                }
                else
                {
                    Response.Redirect("ListBooks.aspx?catelogyid=" + Session["catelogyid"].ToString());
                }
            }

        }
        catch 
        { 
        }
    }
}
